Configure colors of both stdout/stderr
authorAlex Crichton <alex@alexcrichton.com>
Tue, 24 May 2016 18:52:31 +0000 (11:52 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 24 May 2016 18:53:22 +0000 (11:53 -0700)
Previously color configuration only affected stdout, not stder as well.

Closes #2734

src/cargo/core/shell.rs

index ca3ff690c358ee257a9c93862c11f5986356ebe4..c6919840c7b5c57d7c381b760f65a0b98af3086a 100644 (file)
@@ -111,7 +111,7 @@ impl MultiShell {
     }
 
     pub fn set_color_config(&mut self, color: Option<&str>) -> CargoResult<()> {
-        self.out.set_color_config(match color {
+        let cfg = match color {
             Some("auto") => Auto,
             Some("always") => Always,
             Some("never") => Never,
@@ -120,7 +120,9 @@ impl MultiShell {
 
             Some(arg) => bail!("argument for --color must be auto, always, or \
                                 never, but found `{}`", arg),
-        });
+        };
+        self.out.set_color_config(cfg);
+        self.err.set_color_config(cfg);
         Ok(())
     }